package com.sisgh.jefdv1.core.java.keyword.imports.impl;

import com.sisgh.jefdv1.core.java.keyword.imports.Import;
import com.sisgh.jefdv1.core.java.keyword.pack.Package;
import lombok.Data;

import java.util.Set;

@Data
public class Extend implements Import {
    private final Package packagePath;
    private final String name;
    private final Set<String> fieldNames;

    public Extend(final Package packagePath,
                  final String name,
                  final String... names) {
        this.packagePath = packagePath;
        this.name = name;
        this.fieldNames = Set.of(names);
    }

    public boolean contains(final String name) {
        return fieldNames.contains(name);
    }

    @Override
    public String getImport() {
        return "import " + packagePath.getPath() + "." + name;
    }
}
